package com.ice.base.result;

public class ResponseResult {

    /**成功且带数据**/
    public static AjaxResult success(Object object){
        AjaxResult result = new AjaxResult();
        result.setStatus(ResultCodeEnum.DO_SUCCESS.getCode());
        result.setMsg(ResultCodeEnum.DO_SUCCESS.getMessage());
        result.setData(object);
        return result;
    }

    /**成功但不带数据**/
    public static AjaxResult success(){
        return success(null);
    }
    /**默认失败**/
    public static AjaxResult error(){
        AjaxResult result = new AjaxResult();
        result.setStatus(ResultCodeEnum.DO_FAILED.getCode());
        result.setMsg(ResultCodeEnum.DO_FAILED.getMessage());
        return result;
    }
    /**自定义失败**/
    public static AjaxResult errors(Integer code, String msg){
        AjaxResult result = new AjaxResult();
        result.setStatus(code);
        result.setMsg(msg);
        return result;
    }
}
